{% extends 'cms/cms_base.html' %}

{% block title %}
六月论坛-帖子列表
{% endblock %}

{% block content_title %}
这是帖子管理页面
{% endblock %}
{% block head %}
    <script src="{{ url_for('static', filename='cms/js/cms_operate_post.js') }}"></script>
{% endblock %}
{% block content %}
<table class="table table-bordered">
    <thead>
        <tr>
            <th>标题</th>
            <th>发布时间</th>
            <th>板块</th>
            <th>作者</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {% for post in posts %}
        <tr data-post-id="{{ post.id }}" data-high="{{ 1 if post.cms_high else 0 }}">
            <td><a href="{{ url_for('front.article_detail',article_id=post.id) }}" target="_blank">{{ post.article_title }}</a></td>
            <td>{{ post.add_time }}</td>
            <td>{{ post.board.board_name }}</td>
            <td>{{ post.author.username }}</td>
            <td>
                {% if post.highlight %}
                <button class="btn btn-warning btn-xs high-light">取消加精</button>
                {% else %}
                <button class="btn btn-primary btn-xs high-light">加精</button>
                {% endif %}
                <button class="btn btn-danger btn-xs delete-btn">删除</button>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}